package com.mhy.book.app;

import com.mhy.book.mapper.BookMapper;
import com.mhy.book.service.BookService;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

public class BeanLifeMain {
    public static void main(String[] args) {
        ClassPathXmlApplicationContext ioc = new ClassPathXmlApplicationContext("bean_di.xml");
        //BookMapper mapper = ioc.getBean("bookMapper",BookMapper.class);
        //BookService service = ioc.getBean("bookService", BookService.class);
        //service.queryBook();
        BookService service2 = ioc.getBean("bookService2", BookService.class);
        service2.queryBook();

        ioc.close();
    }
}
